<html lang="en">
<head>
<title>Qi manual</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="Qi manual">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="top" href="#Top">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This manual is for Qi (version 1.0-rc4,
30 Jan 2017), which is a simple source builder and package manager.

Copyright (C) 2015, 2016, 2017 Matias A. Fonzo, Argentina,
Santiago del Estero.

     Permission is granted to copy, distribute and/or modify this
     document under the terms of the GNU Free Documentation License,
     Version 1.3 or any later version published by the Free Software
     Foundation; with no Invariant Sections, with no Front-Cover Texts,
     and with no Back-Cover Texts.  A copy of the license is included
     in the section entitled "GNU Free Documentation License".
   -->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
<link rel="stylesheet" type="text/css" href="document-1.0.1.css">
</head>
<body>
<h1 class="settitle">Qi manual</h1>
   <div class="contents">
<h2>Table of Contents</h2>
<ul>
<li><a name="toc_Top" href="#Top">Qi manual</a>
<li><a name="toc_Introduction" href="#Introduction">1 Introduction</a>
<li><a name="toc_Invocation" href="#Invocation">2 Invocation</a>
<ul>
<li><a href="#Invocation">2.1 Environment</a>
<li><a href="#Invocation">2.2 Notes</a>
</li></ul>
<li><a name="toc_The-qirc-file" href="#The-qirc-file">3 The qirc file</a>
<li><a name="toc_Packages" href="#Packages">4 Packages</a>
<ul>
<li><a href="#Packages">4.1 Adding packages</a>
<li><a href="#Packages">4.2 Removing packages</a>
<li><a href="#Packages">4.3 Upgrading packages</a>
<li><a href="#Packages">4.4 Notes</a>
</li></ul>
<li><a name="toc_Recipes" href="#Recipes">5 Recipes</a>
<ul>
<li><a href="#Recipes">5.1 Variables</a>
<ul>
<li><a href="#Recipes">5.1.1 Special variables</a>
<li><a href="#Recipes">5.1.2 Variables from the environment</a>
</li></ul>
<li><a href="#Recipes">5.2 The meta file</a>
<li><a href="#Recipes">5.3 Building packages</a>
<li><a href="#Recipes">5.4 Writing recipes</a>
<ul>
<li><a href="#Recipes">5.4.1 Internal functions</a>
</li></ul>
</li></ul>
<li><a name="toc_Order-files" href="#Order-files">6 Order files</a>
<ul>
<li><a href="#Order-files">6.1 The depends file</a>
</li></ul>
<li><a name="toc_Examine-packages" href="#Examine-packages">7 Examine packages</a>
<li><a name="toc_Messages" href="#Messages">8 Messages</a>
<li><a name="toc_Exit-status" href="#Exit-status">9 Exit status</a>
<li><a name="toc_GNU-Free-Documentation-License" href="#GNU-Free-Documentation-License">Appendix A GNU Free Documentation License</a>
<li><a name="toc_Index" href="#Index">Index</a>
</li></ul>
</div>



<div class="node">
<a name="Top"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Introduction">Introduction</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>

</div>

<h2 class="unnumbered">Qi manual</h2>

<p>This manual is for Qi (version 1.0-rc4,
30 Jan 2017).

<ul class="menu">
<li><a accesskey="1" href="#Introduction">Introduction</a>:                     Purpose, description
<li><a accesskey="2" href="#Invocation">Invocation</a>:                       Command-line interface
<li><a accesskey="3" href="#The-qirc-file">The qirc file</a>:                    Configuration file
<li><a accesskey="4" href="#Packages">Packages</a>:                         Managing packages
<li><a accesskey="5" href="#Recipes">Recipes</a>:                          Building packages
<li><a accesskey="6" href="#Order-files">Order files</a>:                      Handling the build order
<li><a accesskey="7" href="#Examine-packages">Examine packages</a>:                 Debugging purposes
<li><a accesskey="8" href="#Messages">Messages</a>:                         Output messages
<li><a accesskey="9" href="#Exit-status">Exit status</a>:                      Exit codes
<li><a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a>
<li><a href="#Index">Index</a>
</ul>

   <pre class="sp">

</pre>
Copyright &copy; 2015-2017 Matias A. Fonzo, Argentina, Santiago
del Estero.

   <p>The Qi home page can be found at <a href="http://www.dragora.org">http://www.dragora.org</a>. 
Send&nbsp;bug&nbsp;reports&nbsp;or&nbsp;suggestions&nbsp;to&nbsp;<a href="mailto:dragora-users@nongnu.org">dragora-users@nongnu.org</a>.<!-- /@w -->

<div class="node">
<a name="Introduction"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Invocation">Invocation</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">1 Introduction</h2>

<p><a name="index-introduction-1"></a>
Qi is a source builder and a package manager:

   <p>It contains a set of (individual) tools to build, install, remove, and
upgrade software packages.  It follows the philosophy of simplicity
without adding too many features, such as those that can be found in
popular package managers.  Basically it does two things: builds
packages and manages them.

   <p>Qi constructs the sources using recipe names, files that contain
specific instructions to build every source.  As result, a binary
package is obtained which can be installed, removed, upgraded, or
inspected in the system.

   <p>The packages are managed thanks to an external tool called
<em>graft(1)</em>, which provides a mechanism for managing multiple
packages under a single directory hierarchy, it was inspired by both
Depot (Carnegie Mellon University) and Stow (Bob Glickstein).  In this
aspect, Qi complements Graft: it can work with packages, check them,
solve conflicts, and more...

<div class="node">
<a name="Invocation"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#The-qirc-file">The qirc file</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Introduction">Introduction</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">2 Invocation</h2>

<p><a name="index-invocation-2"></a>
The synopsis to invoke Qi is:

<pre class="example">     pkg&lt;action&gt; [options] [package|recipe|order] ...
</pre>
   <p class="noindent">The following commands or actions are supported by Qi:

     <dl>
<dt>&lsquo;<samp><span class="samp">pkghelp</span></samp>&rsquo;<dd>Shows the help.

     <br><dt>&lsquo;<samp><span class="samp">pkgadd</span></samp>&rsquo;<dd>Add the packages to the system using <em>graft(1)</em> for linking.

     <br><dt>&lsquo;<samp><span class="samp">pkgremove</span></samp>&rsquo;<dd>Remove the packages from the system.

     <br><dt>&lsquo;<samp><span class="samp">pkgupgrade</span></samp>&rsquo;<dd>Upgrade software packages.

     <br><dt>&lsquo;<samp><span class="samp">pkgbuild</span></samp>&rsquo;<dd>Build packages using recipe files.

     <br><dt>&lsquo;<samp><span class="samp">pkgorder</span></samp>&rsquo;<dd>Resolves the build order through .order files.

     <br><dt>&lsquo;<samp><span class="samp">pkgerupt</span></samp>&rsquo;<dd>Examine packages for debugging purposes.

     <pre class="sp">
     
     </pre>
     <strong>Global options</strong>

     <p>There are global or common options for the commands, as well as specific to each one.

     <br><dt>&lsquo;<samp><span class="samp">-h</span></samp>&rsquo;<dd>Show options for the given command and exit.

     <pre class="sp">
     
     </pre>
     <strong>Options for command &lsquo;</strong><samp><span class="samp">pkgadd</span></samp><strong>&rsquo;:</strong>

     <br><dt>&lsquo;<samp><span class="samp">-f</span></samp>&rsquo;<dd>Force package installation (implies -p).

     <br><dt>&lsquo;<samp><span class="samp">-P</span></samp>&rsquo;<dd>Extract package on an installation tree.

     <p>This option sets &lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo;.

     <p>Default value: <em>PREFIX/pkg</em>

     <br><dt>&lsquo;<samp><span class="samp">-p</span></samp>&rsquo;<dd>Prune conflicts.

     <br><dt>&lsquo;<samp><span class="samp">-t</span></samp>&rsquo;<dd>Target directory for linking.

     <p>This option sets &lsquo;<samp><span class="samp">${targetdir}</span></samp>&rsquo;.

     <p>Default value: <em>/</em>

     <br><dt>&lsquo;<samp><span class="samp">-V</span></samp>&rsquo;<dd><em>graft(1)</em> very verbose.

     <br><dt>&lsquo;<samp><span class="samp">-w</span></samp>&rsquo;<dd>Warn about the files that will be linked.

     <pre class="sp">
     
     </pre>
     <strong>Options for command &lsquo;</strong><samp><span class="samp">pkgremove</span></samp><strong>&rsquo;:</strong>

     <br><dt>&lsquo;<samp><span class="samp">-k</span></samp>&rsquo;<dd>Keep (don't delete) package directory.

     <br><dt>&lsquo;<samp><span class="samp">-P</span></samp>&rsquo;<dd>Remove from an installation tree.

     <p>This option sets &lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo;.

     <p>Default value: <em>PREFIX/pkg</em>

     <br><dt>&lsquo;<samp><span class="samp">-p</span></samp>&rsquo;<dd>Prune conflicts.

     <br><dt>&lsquo;<samp><span class="samp">-t</span></samp>&rsquo;<dd>Target directory for unlinking.

     <p>This option sets &lsquo;<samp><span class="samp">${targetdir}</span></samp>&rsquo;.

     <p>Default value: <em>/</em>

     <br><dt>&lsquo;<samp><span class="samp">-V</span></samp>&rsquo;<dd><em>graft(1)</em> very verbose.

     <pre class="sp">
     
     </pre>
     <strong>Options for command &lsquo;</strong><samp><span class="samp">pkgupgrade</span></samp><strong>&rsquo;:</strong>

     <br><dt>&lsquo;<samp><span class="samp">-k</span></samp>&rsquo;<dd>Keep (don't delete) package directory.

     <br><dt>&lsquo;<samp><span class="samp">-P</span></samp>&rsquo;<dd>Package installation tree.

     <p>This option sets &lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo;.

     <p>Default value: <em>PREFIX/pkg</em>

     <br><dt>&lsquo;<samp><span class="samp">-t</span></samp>&rsquo;<dd>Target directory.

     <p>This option sets &lsquo;<samp><span class="samp">${targetdir}</span></samp>&rsquo;.

     <p>Default value: <em>/</em>

     <br><dt>&lsquo;<samp><span class="samp">-V</span></samp>&rsquo;<dd>Enable (very) verbose mode.

     <br><dt>&lsquo;<samp><span class="samp">-w</span></samp>&rsquo;<dd>Warn about packages that will be upgraded.

     <pre class="sp">
     
     </pre>
     <strong>Options for command &lsquo;</strong><samp><span class="samp">pkgbuild</span></samp><strong>&rsquo;:</strong>

     <br><dt>&lsquo;<samp><span class="samp">-a</span></samp>&rsquo;<dd>Architecture to use.

     <p>This option sets &lsquo;<samp><span class="samp">${arch}</span></samp>&rsquo;.

     <p>Default value is obtained via <em>uname(1)</em> as &lsquo;<samp><span class="samp">uname -m</span></samp>&rsquo;.

     <br><dt>&lsquo;<samp><span class="samp">-i</span></samp>&rsquo;<dd>Increment release number.

     <p>This option increment the release number when a package is produced.

     <br><dt>&lsquo;<samp><span class="samp">-j</span></samp>&rsquo;<dd>Parallel jobs for the compiler

     <p>This option sets &lsquo;<samp><span class="samp">${jobs}</span></samp>&rsquo;.

     <p>Default value: <em>1</em>

     <br><dt>&lsquo;<samp><span class="samp">-k</span></samp>&rsquo;<dd>Keep (don't delete) &lsquo;<samp><span class="samp">${srcdir}</span></samp>&rsquo; and &lsquo;<samp><span class="samp">${destdir}</span></samp>&rsquo;.

     <br><dt>&lsquo;<samp><span class="samp">-n</span></samp>&rsquo;<dd>Don't create a .tlz package.

     <br><dt>&lsquo;<samp><span class="samp">-o</span></samp>&rsquo;<dd>Where the produced packages are written.

     <p>This option sets &lsquo;<samp><span class="samp">${outdir}</span></samp>&rsquo;.

     <p>Default value: <em>/var/cache/qi/packages</em>

     <br><dt>&lsquo;<samp><span class="samp">-U</span></samp>&rsquo;<dd>Perform package upgrade after build.

     <p>This option calls to <samp><span class="command">pkgupgrade</span></samp>.

     <pre class="sp">
     
     </pre>
     <strong>Options for command &lsquo;</strong><samp><span class="samp">pkgorder</span></samp><strong>&rsquo;:</strong>

     <br><dt>&lsquo;<samp><span class="samp">-x</span></samp>&rsquo;<dd>Exclude depends file.

<h3 class="section">2.1 Environment</h3>

     <p><a name="index-environment-3"></a>
Some influential environment variables:

     <br><dt>&lsquo;<samp><span class="samp">QICFLAGS</span></samp>&rsquo;<dd>C compiler flags for building packages.

     <p>Default value: <em>"-g0 -Os"</em>

     <br><dt>&lsquo;<samp><span class="samp">QICXXFLAGS</span></samp>&rsquo;<dd>C++ compiler flags for building packages.

     <p>Default value: <em>"-g0 -Os"</em>

     <br><dt>&lsquo;<samp><span class="samp">QILDFLAGS</span></samp>&rsquo;<dd>Linker flags for building packages.

     <p>Default value: <em>-s</em>

     <br><dt>&lsquo;<samp><span class="samp">DOPOST</span></samp>&rsquo;<dd>post-install script control variable.

     <p>The <samp><span class="env">DOPOST</span></samp> variable is currently used for <samp><span class="command">pkgadd</span></samp>,
<samp><span class="command">pkgupgrade</span></samp>, <samp><span class="command">pkgbuild</span></samp> (when option -U is given).

     <p>A different value than "DOPOST" omits the execution of the post-install
script (if any).

     <br><dt>&lsquo;<samp><span class="samp">RC</span></samp>&rsquo;<dd>Runtime configuration file.

     <p>A different value than "RC" overrides the configuration file.

     <p>This is used by: <samp><span class="command">pkgadd</span></samp>, <samp><span class="command">pkgremove</span></samp>,
<samp><span class="command">pkgupgrade</span></samp>, <samp><span class="command">pkgbuild</span></samp>.

     <br><dt>&lsquo;<samp><span class="samp">TMPDIR</span></samp>&rsquo;<dd>Temporary directory (by default <em>/tmp</em>).

     <p><samp><span class="env">TMPDIR</span></samp> is expanded with random numbers for major security.

     <p>This is used by: <samp><span class="command">pkgbuild</span></samp>, <samp><span class="command">pkgerupt</span></samp>. 
</dl>

<h3 class="section">2.2 Notes</h3>

<p><a name="index-notes-4"></a>
     <ul>
<li>Command names has been prefixed with &lsquo;<samp><span class="samp">pkg</span></samp>&rsquo; to facilitate the
set in relation to its purpose.

     <li>The <em>PREFIX</em> reference is related with the installation
prefix of Qi.

     <li>All the options can be mixed.  Options specified in the
command-line have priority over the config file <samp><span class="file">qirc</span></samp>. 
If there are no options, and if <samp><span class="file">qirc</span></samp> is not present,
default (internal) values will be used instead. 
</ul>

<div class="node">
<a name="The-qirc-file"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Packages">Packages</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Invocation">Invocation</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">3 The qirc file</h2>

<p><a name="index-the-qirc-file-5"></a>
<samp><span class="file">qirc</span></samp> is the configuration file for Qi used at runtime during the
installation, removal of a package or when a recipe is built.  This
file is optional, and it can be useful to define variables and
configure external tools (such as a download manager) for default use.

     <ul>
<li>Variables are declared as &lsquo;<samp><span class="samp">name=value</span></samp>&rsquo;.

     <li>Declaration of values should only take one line, no line break.

     <li>Assignments like &lsquo;<samp><span class="samp">name=$var</span></samp>&rsquo; are only interpreted as
literal. 
</ul>

<p class="noindent">The options specified in the command-line can override the values
specified in the configuration file.  For more information, see
<a href="#Invocation">Invocation</a>.

<p class="noindent">The order in which Qi looks for this file is:

     <ol type=1 start=1>
<li><samp><span class="env">${HOME}/.qirc</span></samp>
 Effective user.

     <li>&lsquo;<samp><span class="samp">${sysconfdir}/qirc</span></samp>&rsquo;
 System-wide.
        </ol>

   <p>If you intend to run Qi for a specific user, you should copy the file
&lsquo;<samp><span class="samp">${sysconfdir}/qirc</span></samp>&rsquo; to <samp><span class="env">${HOME}/.qirc</span></samp> setting
&lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo; and &lsquo;<samp><span class="samp">${targetdir}</span></samp>&rsquo; for your <samp><span class="env">$HOME</span></samp>.

<div class="node">
<a name="Packages"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Recipes">Recipes</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#The-qirc-file">The qirc file</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">4 Packages</h2>

<p><a name="index-packages-6"></a>
A package is a suite of programs usually distributed in binary form
which may also contain manual pages, documentation, or any other file
associated to a specific software.

   <p>The Qi package format is a simple redistributable <em>tar(1)</em> archive
compressed with <em>lzip(1)</em>.  The package extension ends in ".tlz".

<p class="noindent">Both package installation and package deinstallation are managed using
&lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo; and &lsquo;<samp><span class="samp">${targetdir}</span></samp>&rsquo;:

   <p>&lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo; is a common directory tree where the package contents
is decompressed (resides).  By default the tree is located at
<em>PREFIX/pkg</em>.

   <p>&lsquo;<samp><span class="samp">${targetdir}</span></samp>&rsquo; is a target directory where the links will be
made taking &lsquo;<samp><span class="samp">${packagedir}/package_name</span></samp>&rsquo; into account.

   <p>Packages are installed in self-contained directory trees and symbolic
links from a common area are made to the package files.  This allows
multiple versions of the same package to co-exist on the one system.

   <p>All the links to install or to remove a package are managed using
<em>graft(1)</em>.  Since multiple packages can be installed or removed
at the same time, certain conflicts may arise between the packages.

   <p>According to the User's Guide of Graft<a rel="footnote" href="#fn-1" name="fnd-1"><sup>1</sup></a>,
a conflict is defined as one of the following conditions:

     <ul>
<li>If the package object is a directory and the target object exists
but is not a directory.

     <li>If the package object is not a directory and the target object
exists and is not a symbolic link.

     <li>If the package object is not a directory and the target object
exists and is a symbolic link to something other than the package
object. 
</ul>

<p class="noindent">Qi's default behavior is to not proceed with the installation when a
conflict occurs.  But when a package that is going to be removed is in
conflict with another package, <em>graft(1)</em> removes those parts that
are not in conflict, leaving the links belonging to the original
package.  This behavior can be changed if the option -p is specified
(see the examples below).

<h3 class="section">4.1 Adding packages</h3>

<p><a name="index-adding-packages-7"></a>
This sort order is particularly useful just before the actual package
installation, because it helps to understand how the package
installation works:

     <ol type=1 start=1>
<li>Detects and reports if the package is already installed.

     <li>Ignores some signals up to completing the installation:
HUP INT QUIT ABRT TERM.

     <li>The integrity of the file (package) is checked.

     <li>Creates required directory for the package as
&lsquo;<samp><span class="samp">${packagedir}/package_name</span></samp>&rsquo;.

     <li>Decompress the content of the package in
&lsquo;<samp><span class="samp">${packagedir}/package_name</span></samp>&rsquo;.

     <li>A test of the package is performed before completing the
installation to see if there are no conflicts with another package. 
This is the default behavior if -p is not supplied.

     <li><em>graft(1)</em> is invoked to install symbolic links from
the package installation directory to the target directory.

     <li>If the meta file is readable, the description will be shown for
the package.

     <li>Run post install instructions from <samp><span class="file">post-install</span></samp>, if any.
        </ol>

<p class="noindent"><em>Usage:</em> pkgadd [-hfpVw] [-P &lt;DIR&gt;] [-t &lt;DIR&gt;] [package.tlz ...]

   <p>To install a single package, simply type:

<pre class="example">     pkgadd coreutils-8.24-x86_64+1.tlz
</pre>
   <p>To install multiple packages at once:

<pre class="example">     pkgadd gcc-4.9.3-x86_64+1.tlz rafaela-2.2-i586+1.tlz ...
</pre>
   <p>Warn about the files that will be linked:

<pre class="example">     pkgadd -w gcc-4.9.3-x86_64+1.tlz
</pre>
     <ul>
<li>This is to verify the content of a package before installing it. 
</ul>

   <p>See what happens when a package is installed (very verbose):

<pre class="example">     pkgadd -V mariana-3.0-x86_64+1.tlz
</pre>
     <ul>
<li>This is for a detailed (long) output. 
</ul>

   <p>Installing in a different directory tree and target:

<pre class="example">     pkgadd -P /tmp/pkgdir -T /tmp/targetdir lzip-1.17-i586+1.tlz
</pre>
   <p>When a package is already installed, <samp><span class="command">pkgadd</span></samp> refuses to
continue.  This is to keep some control over the database of your
packages, if you really want to force the installation of a package,
you can use the -f option (which implies -p).  See below.

   <p><strong>Pruning conflicts</strong>

   <p>Remove objects (files, links or directories) from the target
directory that are in conflict with the package directory:

<pre class="example">     pkgadd -p zutils-1.4-x86_64+1.tlz
</pre>
   <p>When the -p option is used, it proceeds to install the package
normally, but first will try to remove any conflict.  Use it with care,
combine this option with -V.

<h3 class="section">4.2 Removing packages</h3>

<p><a name="index-removing-packages-8"></a>
This sort order is particularly useful just before the actual package
deinstallation, because it helps to understand how the package
deinstallation works:

     <ol type=1 start=1>
<li>Look for a package name to remove inside of
&lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo;.  Package names must be specified using the full
package name, such as "name-version-arch+release.tlz" or specifying the
package name directory.

     <li>Ignores some signals up to completing the deinstallation:
HUP INT QUIT ABRT TERM.

     <li><em>graft(1)</em> is invoked to remove symbolic links from
the package installation directory to the target directory:

     <p>If a conflict exists with another package, those links that are not in
conflict will be preserved.  It's possible to prune all the conflicts
using the -p option.

     <li>Remove directories made empty by package deletion.  This has
effect on &lsquo;<samp><span class="samp">${targetdir}</span></samp>&rsquo; but not for &lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo;.

     <li>The package directory is deleted if the option -k is not
supplied.
        </ol>

<p class="noindent"><em>Usage:</em> pkgremove [-hkpV] [-P &lt;DIR&gt;] [-t &lt;DIR&gt;] [package_name ...]

   <p>To remove a package, just execute the command:

<pre class="example">     pkgremove xz-5.2.2-x86_64+1
</pre>
   <p>To remove multiple versions of the same package:

<pre class="example">     pkgremove xz*
</pre>
   <p>To remove multiple packages at once:

<pre class="example">     pkgremove foo bar baz ...
</pre>
   <p>Detailed output (very verbose):

<pre class="example">     pkgremove -V xz-5.2.2-x86_64+1
</pre>
   <p>Removing from a different directory tree and target:

<pre class="example">     pkgremove -P /tmp/pkgdir -T /tmp/targetdir lzip-1.17-x86_64+1
</pre>
   <p>Pruning conflicts:

<pre class="example">     pkgremove -p -V hunter
</pre>
   <h3 class="section">4.3 Upgrading packages</h3>

<p><a name="index-upgrading-packages-9"></a>
This sort order is particularly useful just before the actual package
upgrade, because it helps to understand how the package upgrade works:

     <ol type=1 start=1>
<li>Prepare temporary location for the incoming package.

     <li>Pre-install incoming package into the temporary location.

     <li>Remove packages under the same name: this is considered
as the old packages. (Default behaviour if -k is not supplied).

     <li>Upgrade or install the package calling to <samp><span class="command">pkgadd</span></samp>.

     <li>Delete temporary location of the package.
        </ol>

<p class="noindent"><em>Usage:</em> pkgupgrade [-hkVw] [-P &lt;DIR&gt;] [-t &lt;DIR&gt;] [package.tlz ...]

   <p>Upgrading a package is simple as:

<pre class="example">     pkgupgrade coreutils-8.25-x86_64+1.tlz
</pre>
   <p class="noindent">&lsquo;<samp><span class="samp">pkgupgrade</span></samp>&rsquo; uses <samp><span class="command">pkgadd</span></samp> and <samp><span class="command">pkgremove</span></samp> to
upgrade software packages.  So it inherits the properties of each
utility, except here, only the essential options are provided.  For
example, the option -V (for a detailed output) belongs to when these
utilities are invoked.  The options -P and -t work in the same way as
the previous examples for <samp><span class="command">pkgadd</span></samp>, <samp><span class="command">pkgremove</span></samp>. 
&lsquo;<samp><span class="samp">pkgupgrade</span></samp>&rsquo; will try to update the package or to install it
(in case it has not been installed).

   <p>To see what packages will be updated (if any), always type:

<pre class="example">     pkgupgrade -w coreutils-8.25-x86_64+1.tlz
</pre>
   <h3 class="section">4.4 Notes</h3>

<p><a name="index-notes-10"></a>
     <ul>
<li>Some signals like HUP INT QUIT ABRT TERM are ignored on the
package installation or deinstallation.  The intention is to ignore
the cancellation while the package is being installed or removed (e.g. 
Ctrl+C, terminal window closed, etc.).  The installation or removal
of a package can be crucial for the proper functioning of the system.

     <li>The meta file is read from the directory where the package is
found.

     <li>A post-install script is read from
&lsquo;<samp><span class="samp">${packagedir}/package_name/var/lib/qi/post-install/name.install</span></samp>&rsquo;.

     <li>Default behavior is to upgrade or install a package removing old
packages, this is "packages found under the same name".  If you want to
preserve the multiple versions of the same package, you must pass the
-k option. 
</ul>

<div class="node">
<a name="Recipes"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Order-files">Order files</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Packages">Packages</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">5 Recipes</h2>

<p><a name="index-recipes-11"></a>
A recipe is a file telling qi what to do.  Most often, the recipe
tells qi how to build a binary package from a source tarball.

   <p>A recipe has two parts: a list of variable definitions and a list of
sections.  By convention, the syntax of a section is:

<pre class="example">     section_name() {
       section lines
     }
</pre>
   <p>The section name is followed by parentheses, one space and an opening
brace.  The line finishing the section contains just a closing brace. 
The section names or the function names currently recognized are
&lsquo;<samp><span class="samp">build</span></samp>&rsquo;.

   <p>The &lsquo;<samp><span class="samp">build</span></samp>&rsquo; section is an augmented shell script.  This is the main
section (or <strong>shell function</strong>) which contains the instructions to
build and produce a package.

<h3 class="section">5.1 Variables</h3>

<p><a name="index-variables-12"></a>
A "variable" is a <strong>shell variable</strong> defined either in <samp><span class="file">qirc</span></samp>
or in a recipe to represent a string of text, called the variable's
"value".  These values are substituted by explicit request in the
definitions of other variables or in calls to external commands.

   <p>Variables can represent lists of file names, options to pass to
compilers, programs to run, directories to look in for source files,
directories to write output in, or anything else you can imagine.

   <p>Definitions of variables in qi have four levels of precedence. 
Options which define variables from the command-line override those
specified in the <samp><span class="file">qirc</span></samp> file, while variables defined in the recipe
override those specified in <samp><span class="file">qirc</span></samp>, taking priority over those
variables settled by options via command-line.  Finally, some variables
(arch, jobs, outdir, worktree, tardir, netget, rsync) have default
values if they are not defined anywhere.

   <p>Options that set variables through the command-line can only reference
variables defined in <samp><span class="file">qirc</span></samp> and variables with default values.

   <p>Definitions of variables in <samp><span class="file">qirc</span></samp> can only reference variables
previously defined in <samp><span class="file">qirc</span></samp> and variables with default values.

   <p>Definitions of variables in the recipe can only reference variables
settled by command-line, variables previously defined in the recipe,
variables defined in <samp><span class="file">qirc</span></samp>, and variables with default values.

<h4 class="subsection">5.1.1 Special variables</h4>

<p><a name="index-special-variables-13"></a>
The three variables &lsquo;<samp><span class="samp">arch</span></samp>&rsquo;, &lsquo;<samp><span class="samp">jobs</span></samp>&rsquo;, and &lsquo;<samp><span class="samp">outdir</span></samp>&rsquo; can
only be set using command line options or in <samp><span class="file">qirc</span></samp>.  If not
specified, they have default values.

   <p>&lsquo;<samp><span class="samp">arch</span></samp>&rsquo; is the architecture to compose the package name.  Its
value is available in the recipe as &lsquo;<samp><span class="samp">${arch}</span></samp>&rsquo;.  Default value is
the output of &lsquo;<samp><span class="samp">uname -m</span></samp>&rsquo;.

   <p>&lsquo;<samp><span class="samp">jobs</span></samp>&rsquo; is the number of jobs to pass to the compiler.  Its
default value is available in the recipe as &lsquo;<samp><span class="samp">${jobs}</span></samp>&rsquo;.  Defaults
to &lsquo;<samp><span class="samp">1</span></samp>&rsquo;.

   <p>&lsquo;<samp><span class="samp">outdir</span></samp>&rsquo; is the directory where the produced packages are
written.  This variable cannot be redefined in the recipe.  Defaults to
&lsquo;<samp><span class="samp">/var/cache/qi/packages</span></samp>&rsquo;.

   <p>&lsquo;<samp><span class="samp">worktree</span></samp>&rsquo; is the working tree where archives, patches, and
recipes are expected.  This variable cannot be redefined in the
recipe.  Defaults to &lsquo;<samp><span class="samp">/usr/src/qi</span></samp>&rsquo;.

   <p>The variable &lsquo;<samp><span class="samp">tardir</span></samp>&rsquo; is defined in the recipe to the directory
where the tarball containing the source can be found.  The full name of
the tarball is commonly used as &lsquo;<samp><span class="samp">${tardir}/$tarname</span></samp>&rsquo;.  A value
of &lsquo;<samp><span class="samp">.</span></samp>&rsquo; for &lsquo;<samp><span class="samp">tardir</span></samp>&rsquo; sets it to the value of the CWD (Current
Working Directory), this means, from where the recipe is located.

   <p>The two variables &lsquo;<samp><span class="samp">srcdir</span></samp>&rsquo; and &lsquo;<samp><span class="samp">destdir</span></samp>&rsquo; can be defined in
the recipe, as any other variable, but if they are not, Qi uses default
values for them when building the package.

   <p>&lsquo;<samp><span class="samp">srcdir</span></samp>&rsquo; contains the source code to be compiled, and defaults to
&lsquo;<samp><span class="samp">${program}-${version}</span></samp>&rsquo;.

   <p>&lsquo;<samp><span class="samp">destdir</span></samp>&rsquo; is the place where the built package will be installed,
and defaults to &lsquo;<samp><span class="samp">${TMPDIR}/package-${program}</span></samp>&rsquo;.

   <p>If &lsquo;<samp><span class="samp">pkgname</span></samp>&rsquo; is left undefined, the special variable
&lsquo;<samp><span class="samp">program</span></samp>&rsquo; is assigned by default.  If &lsquo;<samp><span class="samp">pkgversion</span></samp>&rsquo; is left
undefined, the special variable &lsquo;<samp><span class="samp">version</span></samp>&rsquo; is assigned by default.

   <p>&lsquo;<samp><span class="samp">pkgname</span></samp>&rsquo;, &lsquo;<samp><span class="samp">pkgversion</span></samp>&rsquo;, along with &lsquo;<samp><span class="samp">version</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">arch</span></samp>&rsquo;, and &lsquo;<samp><span class="samp">release</span></samp>&rsquo;, are used to produce the name of the
package in the form
&lsquo;<samp><span class="samp">${pkgname}-${pkgversion}-${arch}+${release}.tlz</span></samp>&rsquo;.  All of
them must be defined in the recipe, excepting &lsquo;<samp><span class="samp">arch</span></samp>&rsquo;, which is
optional.

     <ul>
<li>&lsquo;<samp><span class="samp">program</span></samp>&rsquo;: name of the package.

     <li>&lsquo;<samp><span class="samp">version</span></samp>&rsquo;: version of the package.

     <li>&lsquo;<samp><span class="samp">arch</span></samp>&rsquo;: architecture of the package.

     <li>&lsquo;<samp><span class="samp">release</span></samp>&rsquo;: release number of the package. It is recommended to
increase this number after any significant change in the recipe is made. 
</ul>

<p class="noindent">Obtaining sources over the network must be declared in the recipe using
the &lsquo;<samp><span class="samp">fetch</span></samp>&rsquo; variable.  Use double quotes for separated values.

   <p>The variables &lsquo;<samp><span class="samp">netget</span></samp>&rsquo; and &lsquo;<samp><span class="samp">rsync</span></samp>&rsquo; can be defined in
<samp><span class="file">qirc</span></samp> to establish a network downloader in order to get the
sources.  If they are not defined, qi uses default values:

   <p>&lsquo;<samp><span class="samp">netget</span></samp>&rsquo; is the general network downloader tool for use, and
defaults to &lsquo;<samp><span class="samp">wget -c -w1 -t3 --no-check-certificate</span></samp>&rsquo;.

   <p>&lsquo;<samp><span class="samp">rsync</span></samp>&rsquo; is the network tool for sources containing the prefix for
the RSYNC protocol, and defaults to
&lsquo;<samp><span class="samp">rsync -v -a -L -z -i --progress</span></samp>&rsquo;.

<p class="noindent">There are three important variables to produce meta information of the
package: &lsquo;<samp><span class="samp">description</span></samp>&rsquo;, &lsquo;<samp><span class="samp">homepage</span></samp>&rsquo;, &lsquo;<samp><span class="samp">license</span></samp>&rsquo;.

   <p>The variable &lsquo;<samp><span class="samp">description</span></samp>&rsquo; is special to write the description of the
package, which will be shown when installed.

   <p>A description has two parts: a brief description and a long
description.  By convention, the syntax of a description is:

<pre class="example">     description="
     Brief description.
     
     Long description.
     "
</pre>
   <p class="noindent">The first (substantial) line of the value is a brief description of the
software (called the "blurb").  A new (blank) line is followed to
separate the brief description from the long description.

   <p>An example looks like:

<pre class="example">     description="
     A source builder and a package manager.
     
     Qi is a source builder and a package manager.  It contains a set of
     tools to build, install, remove, and upgrade software packages.
     
     Qi follows the philosophy of the simplicity without adding too many
     features, such as those that can be found in popular package managers.
     Basically it does two things: builds packages and manages them.
     "
</pre>
     <ul>
<li>Consider a length limit of 78 characters as maximum. 
See <a href="#Recipes">The meta file</a>. 
</ul>

<p class="noindent">The &lsquo;<samp><span class="samp">homepage</span></samp>&rsquo; variable is used simply to declare the main site or
home of the source, thus:

<pre class="example">     homepage=http://www.dragora.org
</pre>
   <p class="noindent">The variable &lsquo;<samp><span class="samp">license</span></samp>&rsquo; is used for license information<a rel="footnote" href="#fn-2" name="fnd-2"><sup>2</sup></a>. 
Some code in the program can be covered by license A, license B, or
license C.  For "separate licensing" or "heterogeneous licensing",
we suggest using <strong>|</strong> for a disjunction, <strong>&amp;</strong> for a
conjunction (if that ever happens in a significant way), and comma
for heterogeneous licensing.  Comma would have lower precedence.  Plus
added special terms.

<pre class="example">     license="LGPL, GPL | Artistic, GPL + added permission"
</pre>
   <h4 class="subsection">5.1.2 Variables from the environment</h4>

<p><a name="index-variables-from-the-environment-14"></a>
The variables <samp><span class="env">QICFLAGS</span></samp>, <samp><span class="env">QICXXFLAGS</span></samp>, and <samp><span class="env">QILDFLAGS</span></samp> have
no effect by default.  The environment variables such as <samp><span class="env">CFLAGS</span></samp>,
<samp><span class="env">CXXFLAGS</span></samp>, and <samp><span class="env">LDFLAGS</span></samp> are unset at compile time.

   <p>Recommended practices is to set variables in front of &lsquo;<samp><span class="samp">configure</span></samp>&rsquo;
or in front of <em>make(1)</em> instead of exporting to the environment. 
As follows:

   <blockquote>
Variables not defined in a site shell script can be set in the
environment passed to configure. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the configure command line, using &lsquo;<samp><span class="samp">VAR=value</span></samp>&rsquo;.  For
example:

   <p><code>./configure CC=/usr/local2/bin/gcc</code>

   <p><a href="http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html">http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html</a>
</blockquote>

   <blockquote>
Indeed, while configure can notice the definition of CC in &lsquo;<samp><span class="samp">./configure
CC=bizarre-cc</span></samp>&rsquo;, it is impossible to notice it in &lsquo;<samp><span class="samp">CC=bizarre-cc
./configure</span></samp>&rsquo;, which, unfortunately, is what most users do.

   <p>[...]

   <p>configure: error: changes in the environment can compromise the build.

   <p><a href="http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html">http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html</a>
</blockquote>

   <blockquote>
It is not wise for makefiles to depend for their functioning on
environment variables set up outside their control, since this would
cause different users to get different results from the same makefile. 
This is against the whole purpose of most makefiles.

   <p><a href="http://gnu.org/software/make/manual/make.html#Environment">http://gnu.org/software/make/manual/make.html#Environment</a>
</blockquote>

<h3 class="section">5.2 The meta file</h3>

<p><a name="index-the-meta-file-15"></a>
The "meta file" is an external file created by <samp><span class="command">pkgbuild</span></samp> when
a recipe is processed and when a package is produced.  The file is
generated as &lsquo;<samp><span class="samp">${full_pkgname}.tlz.txt</span></samp>&rsquo; which contains
information about the package such as &lsquo;<samp><span class="samp">program</span></samp>&rsquo;, &lsquo;<samp><span class="samp">version</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">release</span></samp>&rsquo;.  Also definitions of the special variables
&lsquo;<samp><span class="samp">fetch</span></samp>&rsquo;, &lsquo;<samp><span class="samp">description</span></samp>&rsquo;, &lsquo;<samp><span class="samp">homepage</span></samp>&rsquo;, &lsquo;<samp><span class="samp">license</span></samp>&rsquo;.

   <p>A meta file has the purpose to extract information and the purpose to
reflect essential information to the user without having to check
inside the package itself.

   <p>The meta file is basically composed as:

<pre class="example">     # Description
     
     variable=value
     ...
</pre>
   <p class="noindent">The description is extracted from the declared variable
&lsquo;<samp><span class="samp">description</span></samp>&rsquo;, where each line is interpreted literally and where
the description is pre-formatted to fit in (exactly) 80 columns.  Plus
&lsquo;<samp><span class="samp"># </span></samp>&rsquo; is prepend to each line.

   <p>Followed by new line, the rest is composed by variables; the inclusion
of its values, may vary.  For example, in addition to the special
variables, there are implicit variables such as &lsquo;<samp><span class="samp">blurb</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">depends</span></samp>&rsquo;.

   <p>The &lsquo;<samp><span class="samp">blurb</span></samp>&rsquo; variable is related to the special variable
&lsquo;<samp><span class="samp">description</span></samp>&rsquo;.  Always taking the first (substantial) line
or "brief description".

   <p>The value of &lsquo;<samp><span class="samp">depends</span></samp>&rsquo; only will be included if the
<samp><span class="file">depends</span></samp> file is a regular file.  See <a href="#Order-files">The depends file</a>.

<p class="noindent">Now let's take a look on a real example of a meta file:

<pre class="example">     # A lossless data compressor based on the LZMA algorithm.
     #
     # Clzip is a lossless data compressor with a user interface similar to
     # the one of gzip or bzip2.  Clzip is about as fast as gzip, compresses
     # most files more than bzip2, and is better than both from a data
     # recovery perspective.
     #
     # Clzip uses the lzip file format; the files produced by clzip are fully
     # compatible with lzip-1.4 or newer, and can be rescued with lziprecover.
     #
     # Clzip is in fact a C language version of lzip, intended for embedded
     # devices or systems lacking a C++ compiler.
     
     QICFLAGS="-g0 -Os"
     QICXXFLAGS="-g0 -Os"
     QILDFLAGS="-s"
     program=clzip
     version=1.8
     release=1
     blurb="A lossless data compressor based on the LZMA algorithm."
     homepage="http://lzip.nongnu.org/clzip.html"
     license="GPLv2+"
     fetch="http://download.savannah.gnu.org/releases/lzip/clzip/clzip-1.8.tar.gz"
     depends=" "
     
</pre>
   <p>Creation of the meta file is made in &lsquo;<samp><span class="samp">${outdir}</span></samp>&rsquo;.

<h3 class="section">5.3 Building packages</h3>

<p><a name="index-building-packages-16"></a>
This sort order is particularly useful just before the actual package
build, because it helps to understand how a package is being built:

     <ol type=1 start=1>
<li>A recipe is read from the current directory, if not, it will be
looked in &lsquo;<samp><span class="samp">${worktree}/recipes</span></samp>&rsquo;.  Names of recipes can be
invoked relative to &lsquo;<samp><span class="samp">${worktree}/recipes</span></samp>&rsquo;.  The recipe must be
a regular file and must be readable by the user who is running the
command.

     <li>Checks are made when the recipe is imported (included), essential
variable names cannot be empty: &lsquo;<samp><span class="samp">program</span></samp>&rsquo;, &lsquo;<samp><span class="samp">version</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">release</span></samp>&rsquo;.  Also the main function &lsquo;<samp><span class="samp">build()</span></samp>&rsquo; must be present.

     <li><samp><span class="command">pkgbuild</span></samp> tries to obtain the sources remotely if it
does not exist locally (&lsquo;<samp><span class="samp">${tardir}</span></samp>&rsquo;).  Once the source is
already in place, its timestamp is updated, creating or updating the
SHA1 sum.

     <li>Required directories are created: &lsquo;<samp><span class="samp">${TMPDIR}/$srcdir</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">${outdir}</span></samp>&rsquo;, &lsquo;<samp><span class="samp">${destdir}/var/lib/qi/recipes</span></samp>&rsquo;.

     <li>Sane ownerships and permissions are applied to the full source
directory: &lsquo;<samp><span class="samp">${TMPDIR}/$srcdir</span></samp>&rsquo;.

     <li>The main function &lsquo;<samp><span class="samp">build()</span></samp>&rsquo; is called.  Exits immediately if
a command exits with a non-zero status.

     <li>A package is going to be created under the following conditions:

          <ul>
<li>If &lsquo;<samp><span class="samp">${destdir}</span></samp>&rsquo; is not empty.

          <li>If the option -n was not given. 
</ul>

     <p>A copy of the recipe (file) is included on
&lsquo;<samp><span class="samp">${destdir}/var/lib/qi/recipes</span></samp>&rsquo; as &lsquo;<samp><span class="samp">${full_pkgname}.recipe</span></samp>&rsquo;.

     <p>If the <samp><span class="file">post-install</span></samp> script is in the current working directory
or from where the recipe name resides, it will be added as
&lsquo;<samp><span class="samp">${destdir}/var/lib/qi/post-install/${full_pkgname}.install</span></samp>&rsquo;.

     <p>The package is produced from the content of &lsquo;<samp><span class="samp">${destdir}</span></samp>&rsquo;.  First,
creating a tarball, and then compressing it using the maximum level of
compression of <em>lzip(1)</em>.

     <li>By default, directories like &lsquo;<samp><span class="samp">${TMPDIR}/$srcdir</span></samp>&rsquo; and
&lsquo;<samp><span class="samp">${destdir}</span></samp>&rsquo; are deleted.

     <li>If the option -U is given, <samp><span class="command">pkgupgrade</span></samp> is invoked to
install or upgrade the package.

        </ol>

<p class="noindent"><em>Usage:</em> pkgbuild [-hiknU] [-a &lt;ARCH&gt;] [-j &lt;JOBS&gt;] [-o &lt;DIR&gt;] [recipe ...]

   <p>To build a single package, simply type:

<pre class="example">     pkgbuild clzip.recipe
</pre>
   <p>Compile passing parallel jobs to the compiler for speed up the process:

<pre class="example">     pkgbuild -j4 clzip.recipe
</pre>
   <p>To build and install or upgrade multiple packages at once:

<pre class="example">     pkgbuild -U clzip.recipe zutils.recipe matias.recipe
</pre>
   <p>Reading recipes and building from the output of a command:

<pre class="example">     cat depends | pkgbuild -
</pre>
   <p>Incrementing the release number after a significant change in a recipe:
<pre class="example">     pkgbuild -i stargazer.recipe
</pre>
   <p class="noindent">If the recipe name cannot be read from the current directory or from
a specific path name, &lsquo;<samp><span class="samp">${worktree}/recipes</span></samp>&rsquo; is used for the
search:

   <p>There is a special case for the names of recipes &lsquo;<samp><span class="samp">recipe</span></samp>&rsquo;. 
<samp><span class="command">pkgbuild</span></samp> can complete the recipe name without being required
to be specified in the command-line, only if the name of the recipe is
&lsquo;<samp><span class="samp">recipe</span></samp>&rsquo;.  For example:

<pre class="example">     pkgbuild devel/gcc
</pre>
   <p>Will complete the search as &lsquo;<samp><span class="samp">${worktree}/recipes/devel/gcc/recipe</span></samp>&rsquo;.

<h3 class="section">5.4 Writing recipes</h3>

<p><a name="index-writing-recipes-17"></a>

<h4 class="subsection">5.4.1 Internal functions</h4>

<p><a name="index-internal-functions-18"></a>
Some internal functions are available to be applied on the recipe:

     <dl>
<dt>&lsquo;<samp><span class="samp">unpack()</span></samp>&rsquo;<dd>The unpack function can decompress multiple (compressed) files while
verifies the integrity.  Depending on where the function is called,
the decompression occurs in the current working directory.

     <p>Usage: <code>unpack file(s) ...</code>

     <p>The cases supported for the special extensions are: *.tar, *.tar.*,
*.tgz*, *.tbz*, *.tlz*, *.txz*, *.zip, *.ZIP, *.gz, *.bz2, *.lz. 
</dl>

<div class="node">
<a name="Order-files"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Examine-packages">Examine packages</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Recipes">Recipes</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">6 Order files</h2>

<p><a name="index-g_t_002eorder-files-19"></a>
<samp><span class="command">pkgorder</span></samp> has the purpose to resolve the build order through
.order files.  In other words, is a good complement for
<samp><span class="command">pkgbuild</span></samp>.

<p class="noindent"><em>Usage:</em> pkgorder [-x] [file_name.order ...]

<p class="noindent">Basically, <samp><span class="command">pkgorder</span></samp> reads from a declared file which ends in
".order".  The output is an ordered list of recipe names which can be
passed to <samp><span class="command">pkgbuild</span></samp> (via a pipe) to build a number or a series
of packages.

   <p><span class="sc">Declaration</span>

   <p>If 'a' depends on 'b' and 'c', and 'c' depends on 'b' as well, the file
might look like:

<pre class="example">     a.recipe: c.recipe b.recipe
     b.recipe:
     c.recipe: b.recipe
</pre>
   <p>Each letter represents a recipe name, complete dependencies for
the first recipe name are listed in descending order, which is
printed from right to left, and removed from left to right:

   <p><span class="sc">Output</span>

<pre class="example">     b.recipe
     c.recipe
     a.recipe
</pre>
     <ul>
<li>Commented lines starting with a '#' are allowed.  Blank lines,
colons, parentheses, and end of line are removed. 
</ul>

<h3 class="section">6.1 The depends file</h3>

<p><a name="index-the-depends-file-20"></a>
When <samp><span class="command">pkgorder</span></samp> read from an order file; by default, it will
proceed to read the dependencies of each recipe.  This behavior can be
omitted if the -x option is given.

   <p>The procedure for reading the dependencies of each recipe is
extracting the directory location where the order file resides.  Then
it iterates over the declared items extracting its location in search
of the special file <samp><span class="file">depends</span></samp>.

     <ul>
<li>The <samp><span class="file">depends</span></samp> file only is read (sequentially) if it is
a regular file and is not empty. 
</ul>

<p class="noindent">The special file <samp><span class="file">depends</span></samp> must contain a list of prerequisites
for the recipe.  Prerequisites are names of valid recipes, including
its location.  The location must be relative to &lsquo;<samp><span class="samp">${worktree}</span></samp>&rsquo;
(variable described in <a href="#Recipes">Recipes</a>).

   <p>Example of a <samp><span class="file">depends</span></samp> file declared for <em>bash.recipe</em>:

<pre class="example">     libs/readline/readline.recipe
</pre>
   <p>Then, if <em>core/bash/bash.recipe</em> has been declared on
<em>core.order</em>, the output would be:

<pre class="example">     ...
     libs/readline/readline.recipe
     core/bash/bash.recipe
     ...
</pre>
   <p>Combined in a pipe, <em>readline</em> represents the first dependency
of <em>bash</em>:

<pre class="example">     <code>pkgorder core.order | pkgbuild -U -</code>
</pre>
   <div class="node">
<a name="Examine-packages"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Messages">Messages</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Order-files">Order files</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">7 Examine packages</h2>

<p><a name="index-examine-packages-21"></a>
<samp><span class="command">pkgerupt</span></samp> is a special command to examine packages for
debugging purposes.

<p class="noindent"><em>Usage:</em> pkgerupt [-h] [package.tlz ...]

   <p>When a package name is given <samp><span class="command">pkgerupt</span></samp> will create a random
directory for the package.  The prefix directory where the random
directory is created is controlled by the <samp><span class="env">TMPDIR</span></samp> variable,
by default <samp><span class="env">TMPDIR</span></samp> is assigned to <em>/tmp</em>.  Creation mode
is "u=,g=rwx,o=rwx" (0700).

   <p>The extraction to inspecting a package is equivalent to the shell
instruction:

<pre class="example">     <code>( umask 000 &amp;&amp; cd -- $PRVDIR &amp;&amp; lzip -cd - | tar -xf - ) &lt; $file</code>
</pre>
   <p>The package content is decompressed in the random (private) directory
via pipe.  Creation mode is "u=rwx,g=rwx,o=rwx" (0777).

   <p>If there is any substantial change, consider increasing the build
number when repackaging: edit the value of the &lsquo;<samp><span class="samp">release</span></samp>&rsquo; variable
(recipe), compose the output file using the new number.

<div class="node">
<a name="Messages"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Exit-status">Exit status</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Examine-packages">Examine packages</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">8 Messages</h2>

<p><a name="index-output-messages-22"></a>
Some symbols are used for output messages to help to identify
the messages shown by the tools in Qi.  There are four simple
categories where the symbols are represented:

   <pre class="sp">

</pre>
<strong>Specifics</strong>

   <p>This symbols are unique to identify the running tool:

     <dl>
<dt>&lsquo;<samp><span class="samp">+</span></samp>&rsquo;<dd>This symbol belongs to the <samp><span class="command">pkgadd</span></samp> tool.

     <br><dt>&lsquo;<samp><span class="samp">-</span></samp>&rsquo;<dd>This symbol belongs to the <samp><span class="command">pkgremove</span></samp> tool.

     <br><dt>&lsquo;<samp><span class="samp">~</span></samp>&rsquo;<dd>This symbol belongs to the <samp><span class="command">pkgupgrade</span></samp> tool.

     <br><dt>&lsquo;<samp><span class="samp">#</span></samp>&rsquo;<dd>This symbol belongs to the <samp><span class="command">pkgbuild</span></samp> tool.

     <br><dt>&lsquo;<samp><span class="samp">=</span></samp>&rsquo;<dd>This symbol belongs to the <samp><span class="command">pkgerupt</span></samp> tool.

     <br><dt>&lsquo;<samp><span class="samp">%</span></samp>&rsquo;<dd>This symbol is used to scan a package or to warn when
the option is used.

     <p>Specific symbols are enclosed between &lsquo;<samp><span class="samp">( )</span></samp>&rsquo;. 
</dl>

     <dl>
<strong>Preventive</strong>

     <p>Preventive symbols are intended to alert the user about unforeseen
or important situations, and to meet requirements before proceeding:

     <dt>&lsquo;<samp><span class="samp">*</span></samp>&rsquo;<dd>Normally used for testing compressed sources, obtain remote sources,
or set system permissions.

     <p>Preventive symbols are enclosed between &lsquo;<samp><span class="samp">[ ]</span></samp>&rsquo;. 
</dl>

     <dl>
<strong>Informative</strong>

     <p>Informative symbols are intended to inform users the most essential
tasks during the execution:

     <dt>&lsquo;<samp><span class="samp">i</span></samp>&rsquo;<dd>Symbol used when a task is going to be performed or when a task has
been completed.

     <br><dt>&lsquo;<samp><span class="samp">!</span></samp>&rsquo;<dd>This symbol informs about deleting files.

     <p>Informative symbols are enclosed between &lsquo;<samp><span class="samp">[ ]</span></samp>&rsquo;. 
</dl>

   <p><strong>Transitory</strong>

   <p>Transitory symbols are part for occasional changes (&lsquo;<samp><span class="samp">@</span></samp>&rsquo;) but no
less important.  Also to invoke Qi tools externally (&lsquo;<samp><span class="samp">^</span></samp>&rsquo;).

   <p>Transitory symbols are enclosed between &lsquo;<samp><span class="samp">{ }</span></samp>&rsquo;.

<div class="node">
<a name="Exit-status"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#GNU-Free-Documentation-License">GNU Free Documentation License</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Messages">Messages</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">9 Exit status</h2>

<p><a name="index-exit-codes-23"></a>
All the conditions of exit codes are described in this chapter.

     <dl>
<dt>&lsquo;<samp><span class="samp">0</span></samp>&rsquo;<dd>Successful completion (no errors).

     <br><dt>&lsquo;<samp><span class="samp">1</span></samp>&rsquo;<dd><strong>Minor common errors:</strong>

          <ul>
<li>Illegal option.

          <li>Option requires an argument.

          <li>Internal function to load not found.

          <li>Program (prerequisite) is not available. 
</ul>

     <br><dt>&lsquo;<samp><span class="samp">2</span></samp>&rsquo;<dd><strong>Command execution error</strong>

     <p>Evaluation of external commands or shell arguments.  If it fails,
returns 2.

     <br><dt>&lsquo;<samp><span class="samp">3</span></samp>&rsquo;<dd><strong>Integrity check error for compressed files</strong>

     <p>Compressed files means:

          <ul>
<li>All the tarballs supported by <em>tar(1)</em>.

          <li>Zip files supported by <em>unzip(1)</em>.

          <li>Gzip files supported by <em>gzip(1)</em>.

          <li>Bzip2 files supported by <em>bzip2(1)</em>.

          <li>Lzip files supported by <em>lzip(1)</em>. 
</ul>

     <br><dt>&lsquo;<samp><span class="samp">4</span></samp>&rsquo;<dd><strong>File empty, not regular, or expected</strong>

     <p>Commonly, it is expected:

          <ul>
<li>A binary package (.tlz).

          <li>An installed package to remove.

          <li>A recipe file.

          <li>A file of order (.order). 
</ul>

     <br><dt>&lsquo;<samp><span class="samp">5</span></samp>&rsquo;<dd><strong>Empty or not defined variable</strong>

     <p>This exit code is used for reporting about empty or undefined variables. 
Usually, variables of the recipe or assigned arrays that are tested.

     <br><dt>&lsquo;<samp><span class="samp">6</span></samp>&rsquo;<dd><strong>Package already installed</strong>

     <p>The package directory for an incoming package already exists.

     <br><dt>&lsquo;<samp><span class="samp">10</span></samp>&rsquo;<dd><strong>Network manager error</strong>

     <p>Exit status from the execution of the network manager tool and its
arguments. 
</dl>

<p class="noindent"><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Error messages are reported to the standard error. 
</td></tr></table>

<div class="node">
<a name="GNU-Free-Documentation-License"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Index">Index</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Exit-status">Exit status</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="appendix">Appendix A GNU Free Documentation License</h2>

<!-- The GNU Free Documentation License. -->
<div align="center">Version 1.3, 3 November 2008</div>

<!-- This file is intended to be included within another document, -->
<!-- hence no sectioning command or @node. -->
<pre class="display">     Copyright &copy; 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
     <a href="http://fsf.org/">http://fsf.org/</a>
     
     Everyone is permitted to copy and distribute verbatim copies
     of this license document, but changing it is not allowed.
</pre>
     <ol type=1 start=0>
<li>PREAMBLE

     <p>The purpose of this License is to make a manual, textbook, or other
functional and useful document <dfn>free</dfn> in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially. 
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.

     <p>This License is a kind of &ldquo;copyleft&rdquo;, which means that derivative
works of the document must themselves be free in the same sense.  It
complements the GNU General Public License, which is a copyleft
license designed for free software.

     <p>We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does.  But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book.  We recommend this License
principally for works whose purpose is instruction or reference.

     <li>APPLICABILITY AND DEFINITIONS

     <p>This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License.  Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein.  The &ldquo;Document&rdquo;, below,
refers to any such manual or work.  Any member of the public is a
licensee, and is addressed as &ldquo;you&rdquo;.  You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.

     <p>A &ldquo;Modified Version&rdquo; of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.

     <p>A &ldquo;Secondary Section&rdquo; is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject.  (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.)  The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.

     <p>The &ldquo;Invariant Sections&rdquo; are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.  If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant.  The Document may contain zero
Invariant Sections.  If the Document does not identify any Invariant
Sections then there are none.

     <p>The &ldquo;Cover Texts&rdquo; are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.  A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.

     <p>A &ldquo;Transparent&rdquo; copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters.  A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent. 
An image format is not Transparent if used for any substantial amount
of text.  A copy that is not &ldquo;Transparent&rdquo; is called &ldquo;Opaque&rdquo;.

     <p>Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input
format, SGML or XML using a publicly available
DTD, and standard-conforming simple HTML,
PostScript or PDF designed for human modification.  Examples
of transparent image formats include PNG, XCF and
JPG.  Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, SGML or
XML for which the DTD and/or processing tools are
not generally available, and the machine-generated HTML,
PostScript or PDF produced by some word processors for
output purposes only.

     <p>The &ldquo;Title Page&rdquo; means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page.  For works in
formats which do not have any title page as such, &ldquo;Title Page&rdquo; means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.

     <p>The &ldquo;publisher&rdquo; means any person or entity that distributes copies
of the Document to the public.

     <p>A section &ldquo;Entitled XYZ&rdquo; means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language.  (Here XYZ stands for a
specific section name mentioned below, such as &ldquo;Acknowledgements&rdquo;,
&ldquo;Dedications&rdquo;, &ldquo;Endorsements&rdquo;, or &ldquo;History&rdquo;.)  To &ldquo;Preserve the Title&rdquo;
of such a section when you modify the Document means that it remains a
section &ldquo;Entitled XYZ&rdquo; according to this definition.

     <p>The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document.  These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.

     <li>VERBATIM COPYING

     <p>You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License.  You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute.  However, you may accept
compensation in exchange for copies.  If you distribute a large enough
number of copies you must also follow the conditions in section 3.

     <p>You may also lend copies, under the same conditions stated above, and
you may publicly display copies.

     <li>COPYING IN QUANTITY

     <p>If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover.  Both covers must also clearly and legibly identify
you as the publisher of these copies.  The front cover must present
the full title with all words of the title equally prominent and
visible.  You may add other material on the covers in addition. 
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.

     <p>If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.

     <p>If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material. 
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.

     <p>It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.

     <li>MODIFICATIONS

     <p>You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it.  In addition, you must do these things in the Modified Version:

          <ol type=A start=1>
<li>Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document).  You may use the same title as a previous version
if the original publisher of that version gives permission.

          <li>List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.

          <li>State on the Title page the name of the publisher of the
Modified Version, as the publisher.

          <li>Preserve all the copyright notices of the Document.

          <li>Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.

          <li>Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.

          <li>Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.

          <li>Include an unaltered copy of this License.

          <li>Preserve the section Entitled &ldquo;History&rdquo;, Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page.  If
there is no section Entitled &ldquo;History&rdquo; in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.

          <li>Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on.  These may be placed in the &ldquo;History&rdquo; section. 
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.

          <li>For any section Entitled &ldquo;Acknowledgements&rdquo; or &ldquo;Dedications&rdquo;, Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.

          <li>Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles.  Section numbers
or the equivalent are not considered part of the section titles.

          <li>Delete any section Entitled &ldquo;Endorsements&rdquo;.  Such a section
may not be included in the Modified Version.

          <li>Do not retitle any existing section to be Entitled &ldquo;Endorsements&rdquo; or
to conflict in title with any Invariant Section.

          <li>Preserve any Warranty Disclaimers.
          </ol>

     <p>If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant.  To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice. 
These titles must be distinct from any other section titles.

     <p>You may add a section Entitled &ldquo;Endorsements&rdquo;, provided it contains
nothing but endorsements of your Modified Version by various
parties&mdash;for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.

     <p>You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version.  Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity.  If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.

     <p>The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.

     <li>COMBINING DOCUMENTS

     <p>You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.

     <p>The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy.  If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number. 
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.

     <p>In the combination, you must combine any sections Entitled &ldquo;History&rdquo;
in the various original documents, forming one section Entitled
&ldquo;History&rdquo;; likewise combine any sections Entitled &ldquo;Acknowledgements&rdquo;,
and any sections Entitled &ldquo;Dedications&rdquo;.  You must delete all
sections Entitled &ldquo;Endorsements.&rdquo;

     <li>COLLECTIONS OF DOCUMENTS

     <p>You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.

     <p>You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.

     <li>AGGREGATION WITH INDEPENDENT WORKS

     <p>A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an &ldquo;aggregate&rdquo; if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit. 
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.

     <p>If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form. 
Otherwise they must appear on printed covers that bracket the whole
aggregate.

     <li>TRANSLATION

     <p>Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4. 
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections.  You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers.  In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.

     <p>If a section in the Document is Entitled &ldquo;Acknowledgements&rdquo;,
&ldquo;Dedications&rdquo;, or &ldquo;History&rdquo;, the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.

     <li>TERMINATION

     <p>You may not copy, modify, sublicense, or distribute the Document
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense, or distribute it is void, and
will automatically terminate your rights under this License.

     <p>However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.

     <p>Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

     <p>Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, receipt of a copy of some or all of the same material does
not give you any rights to use it.

     <li>FUTURE REVISIONS OF THIS LICENSE

     <p>The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time.  Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.  See
<a href="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</a>.

     <p>Each version of the License is given a distinguishing version number. 
If the Document specifies that a particular numbered version of this
License &ldquo;or any later version&rdquo; applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation.  If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.  If the Document
specifies that a proxy can decide which future versions of this
License can be used, that proxy's public statement of acceptance of a
version permanently authorizes you to choose that version for the
Document.

     <li>RELICENSING

     <p>&ldquo;Massive Multiauthor Collaboration Site&rdquo; (or &ldquo;MMC Site&rdquo;) means any
World Wide Web server that publishes copyrightable works and also
provides prominent facilities for anybody to edit those works.  A
public wiki that anybody can edit is an example of such a server.  A
&ldquo;Massive Multiauthor Collaboration&rdquo; (or &ldquo;MMC&rdquo;) contained in the
site means any set of copyrightable works thus published on the MMC
site.

     <p>&ldquo;CC-BY-SA&rdquo; means the Creative Commons Attribution-Share Alike 3.0
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.

     <p>&ldquo;Incorporate&rdquo; means to publish or republish a Document, in whole or
in part, as part of another Document.

     <p>An MMC is &ldquo;eligible for relicensing&rdquo; if it is licensed under this
License, and if all works that were first published under this License
somewhere other than this MMC, and subsequently incorporated in whole
or in part into the MMC, (1) had no cover texts or invariant sections,
and (2) were thus incorporated prior to November 1, 2008.

     <p>The operator of an MMC Site may republish an MMC contained in the site
under CC-BY-SA on the same site at any time before August 1, 2009,
provided the MMC is eligible for relicensing.

        </ol>

<h3 class="heading">ADDENDUM: How to use this License for your documents</h3>

<p>To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:

<pre class="smallexample">       Copyright (C)  <var>year</var>  <var>your name</var>.
       Permission is granted to copy, distribute and/or modify this document
       under the terms of the GNU Free Documentation License, Version 1.3
       or any later version published by the Free Software Foundation;
       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
       Texts.  A copy of the license is included in the section entitled ``GNU
       Free Documentation License''.
</pre>
   <p>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the &ldquo;with<small class="dots">...</small>Texts.&rdquo; line with this:

<pre class="smallexample">         with the Invariant Sections being <var>list their titles</var>, with
         the Front-Cover Texts being <var>list</var>, and with the Back-Cover Texts
         being <var>list</var>.
</pre>
   <p>If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.

   <p>If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.

<!-- Local Variables: -->
<!-- ispell-local-pdict: "ispell-dict" -->
<!-- End: -->
<div class="node">
<a name="Index"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#GNU-Free-Documentation-License">GNU Free Documentation License</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="unnumbered">Index</h2>

<ul class="index-cp" compact>
<li><a href="#index-g_t_002eorder-files-19">.order files</a>: <a href="#Order-files">Order files</a></li>
<li><a href="#index-adding-packages-7">adding packages</a>: <a href="#Packages">Packages</a></li>
<li><a href="#index-building-packages-16">building packages</a>: <a href="#Recipes">Recipes</a></li>
<li><a href="#index-environment-3">environment</a>: <a href="#Invocation">Invocation</a></li>
<li><a href="#index-examine-packages-21">examine packages</a>: <a href="#Examine-packages">Examine packages</a></li>
<li><a href="#index-exit-codes-23">exit codes</a>: <a href="#Exit-status">Exit status</a></li>
<li><a href="#index-internal-functions-18">internal functions</a>: <a href="#Recipes">Recipes</a></li>
<li><a href="#index-introduction-1">introduction</a>: <a href="#Introduction">Introduction</a></li>
<li><a href="#index-invocation-2">invocation</a>: <a href="#Invocation">Invocation</a></li>
<li><a href="#index-notes-10">notes</a>: <a href="#Packages">Packages</a></li>
<li><a href="#index-notes-4">notes</a>: <a href="#Invocation">Invocation</a></li>
<li><a href="#index-output-messages-22">output messages</a>: <a href="#Messages">Messages</a></li>
<li><a href="#index-packages-6">packages</a>: <a href="#Packages">Packages</a></li>
<li><a href="#index-recipes-11">recipes</a>: <a href="#Recipes">Recipes</a></li>
<li><a href="#index-removing-packages-8">removing packages</a>: <a href="#Packages">Packages</a></li>
<li><a href="#index-special-variables-13">special variables</a>: <a href="#Recipes">Recipes</a></li>
<li><a href="#index-the-depends-file-20">the depends file</a>: <a href="#Order-files">Order files</a></li>
<li><a href="#index-the-meta-file-15">the meta file</a>: <a href="#Recipes">Recipes</a></li>
<li><a href="#index-the-qirc-file-5">the qirc file</a>: <a href="#The-qirc-file">The qirc file</a></li>
<li><a href="#index-upgrading-packages-9">upgrading packages</a>: <a href="#Packages">Packages</a></li>
<li><a href="#index-variables-12">variables</a>: <a href="#Recipes">Recipes</a></li>
<li><a href="#index-variables-from-the-environment-14">variables from the environment</a>: <a href="#Recipes">Recipes</a></li>
<li><a href="#index-writing-recipes-17">writing recipes</a>: <a href="#Recipes">Recipes</a></li>
   </ul><div class="footnote">
<hr>
<a name="texinfo-footnotes-in-document"></a><h4>Footnotes</h4><p class="footnote"><small>[<a name="fn-1" href="#fnd-1">1</a>]</small> The official guide
for Graft can be found at
<a href="http://peters.gormand.com.au/Home/tools/graft/graft.html">http://peters.gormand.com.au/Home/tools/graft/graft.html</a>.</p>

   <p class="footnote"><small>[<a name="fn-2" href="#fnd-2">2</a>]</small> 
The proposal for &lsquo;<samp><span class="samp">license</span></samp>&rsquo; was made by Richard M. Stallman at
<a href="http://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html">http://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html</a>.</p>

   <hr></div>

</body></html>

<!--

Local Variables:
coding: iso-8859-1
End:

-->
